/**
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: pke parameter get
 *
 * Create: 2023-05-31
*/

#include "hal_pke_reg.h"
#include "drv_pke.h"
#include "crypto_pke_struct.h"
#include "crypto_curve_param.h"

#define PKE_LEN_192_OFFSET 48
#define PKE_LEN_224_OFFSET 40
#define PKE_LEN_256_OFFSET 40
#define PKE_LEN_384_OFFSET 24
#define PKE_LEN_448_OFFSET 16
#define PKE_LEN_512_OFFSET 8

static const td_u8 g_const_0[DRV_PKE_LEN_576] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 g_const_1[DRV_PKE_LEN_576] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P192R
static const td_u8 ecc_nist_p192_p[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 ecc_nist_p192_a[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p192_b[] = {
    0x64, 0x21, 0x05, 0x19, 0xe5, 0x9c, 0x80, 0xe7, 0x0f, 0xa7, 0xe9, 0xab, 0x72, 0x24, 0x30, 0x49,
    0xfe, 0xb8, 0xde, 0xec, 0xc1, 0x46, 0xb9, 0xb1
};

static const td_u8 ecc_nist_p192_gx[] = {
    0x18, 0x8d, 0xa8, 0x0e, 0xb0, 0x30, 0x90, 0xf6, 0x7c, 0xbf, 0x20, 0xeb, 0x43, 0xa1, 0x88, 0x00,
    0xf4, 0xff, 0x0a, 0xfd, 0x82, 0xff, 0x10, 0x12
};

static const td_u8 ecc_nist_p192_gy[] = {
    0x07, 0x19, 0x2b, 0x95, 0xff, 0xc8, 0xda, 0x78, 0x63, 0x10, 0x11, 0xed, 0x6b, 0x24, 0xcd, 0xd5,
    0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11
};

static const td_u8 ecc_nist_p192_n[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0xde, 0xf8, 0x36,
    0x14, 0x6b, 0xc9, 0xb1, 0xb4, 0xd2, 0x28, 0x31
};

const drv_pke_ecc_curve g_nist_p192_param = {
    .p = ecc_nist_p192_p,
    .a = ecc_nist_p192_a,
    .b = ecc_nist_p192_b,
    .gx = ecc_nist_p192_gx,
    .gy = ecc_nist_p192_gy,
    .n = ecc_nist_p192_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_192,
    .ecc_type = DRV_PKE_ECC_TYPE_FIPS_P192R
};

static const td_u8 ecc_nist_p192_mont_a[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p192_mont_b[] = {
    0x73, 0xc8, 0xee, 0xc5, 0x57, 0xc0, 0xb1, 0x31, 0x72, 0x81, 0xcd, 0xb2, 0x19, 0x07, 0x6a, 0xe2,
    0x62, 0xd9, 0xe4, 0x06, 0xa6, 0xe3, 0x3a, 0x98
};

static const td_u8 ecc_nist_p192_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p192_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x21, 0x07, 0xc9,
    0xeb, 0x94, 0x36, 0x4e, 0x4b, 0x2d, 0xd7, 0xcf
};

static const td_u8 ecc_nist_p192_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p192_rrn[] = {
    0x28, 0xbe, 0x56, 0x77, 0xea, 0x05, 0x81, 0xa2, 0x46, 0x96, 0xea, 0x5b, 0xbb, 0x3a, 0x6b, 0xee,
    0xce, 0x66, 0xba, 0xcc, 0xde, 0xb3, 0x59, 0x61
};

static const td_u32 ecc_nist_p192_mont_param_n[PKE_MONT_PARAM_LEN] = {0x88267207, 0xddbcf2f};

static const td_u32 ecc_nist_p192_mont_param_p[PKE_MONT_PARAM_LEN] = {0x0, 0x1};

static const pke_ecc_init_param g_nist_p192_init_param = {
    .mont_a = ecc_nist_p192_mont_a,
    .mont_b = ecc_nist_p192_mont_b,
    .mont_1_p = ecc_nist_p192_mont_1_p,
    .mont_1_n = ecc_nist_p192_mont_1_n,
    .rrp = ecc_nist_p192_rrp,
    .rrn = ecc_nist_p192_rrn,
    .const_1 = g_const_1 + PKE_LEN_192_OFFSET, /* here use the same value,
                                                  but the length is determined by the curve->ksize. */
    .const_0 = g_const_0,
    .mont_param_n = ecc_nist_p192_mont_param_n,
    .mont_param_p = ecc_nist_p192_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P224R
static const td_u8 ecc_nist_p224_p[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p224_a[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe
};

static const td_u8 ecc_nist_p224_b[] = {
    0x00, 0x00, 0x00, 0x00, 0xb4, 0x05, 0x0a, 0x85, 0x0c, 0x04, 0xb3, 0xab, 0xf5, 0x41, 0x32, 0x56,
    0x50, 0x44, 0xb0, 0xb7, 0xd7, 0xbf, 0xd8, 0xba, 0x27, 0x0b, 0x39, 0x43, 0x23, 0x55, 0xff, 0xb4
};

static const td_u8 ecc_nist_p224_gx[] = {
    0x00, 0x00, 0x00, 0x00, 0xb7, 0x0e, 0x0c, 0xbd, 0x6b, 0xb4, 0xbf, 0x7f, 0x32, 0x13, 0x90, 0xb9,
    0x4a, 0x03, 0xc1, 0xd3, 0x56, 0xc2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xd6, 0x11, 0x5c, 0x1d, 0x21
};

static const td_u8 ecc_nist_p224_gy[] = {
    0x00, 0x00, 0x00, 0x00, 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6,
    0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, 0x44, 0xd5, 0x81, 0x99, 0x85, 0x00, 0x7e, 0x34
};

static const td_u8 ecc_nist_p224_n[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0x16, 0xa2, 0xe0, 0xb8, 0xf0, 0x3e, 0x13, 0xdd, 0x29, 0x45, 0x5c, 0x5c, 0x2a, 0x3d
};

static const drv_pke_ecc_curve g_nist_p224_param = {
    .p = ecc_nist_p224_p,
    .a = ecc_nist_p224_a,
    .b = ecc_nist_p224_b,
    .gx = ecc_nist_p224_gx,
    .gy = ecc_nist_p224_gy,
    .n = ecc_nist_p224_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_224,
    .ecc_type = DRV_PKE_ECC_TYPE_FIPS_P224R
};

static const td_u8 ecc_nist_p224_mont_a[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p224_mont_b[] = {
    0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x2f, 0x93, 0x3d, 0xce, 0xba, 0x98, 0xc8, 0x52, 0x81, 0x51,
    0x10, 0x7a, 0xc2, 0xf3, 0xcc, 0xf0, 0x13, 0x10, 0xe7, 0x68, 0xcd, 0xf6, 0x63, 0xc0, 0x59, 0xcd
};

static const td_u8 ecc_nist_p224_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_nist_p224_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x5d,
    0x1f, 0x47, 0x0f, 0xc1, 0xec, 0x22, 0xd6, 0xba, 0xa3, 0xa3, 0xd5, 0xc3, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_nist_p224_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p224_rrn[] = {
    0x00, 0x00, 0x00, 0x00, 0xb1, 0xe9, 0x79, 0x61, 0x6a, 0xd1, 0x5f, 0x7c, 0xd9, 0x71, 0x48, 0x56,
    0xab, 0xc8, 0xff, 0x59, 0x31, 0xd6, 0x3f, 0x4b, 0x29, 0x94, 0x7a, 0x69, 0x5f, 0x51, 0x7d, 0x15
};

static const td_u32 ecc_nist_p224_mont_param_n[PKE_MONT_PARAM_LEN] = {0xd6e24270, 0x6a1fc2eb};

static const td_u32 ecc_nist_p224_mont_param_p[PKE_MONT_PARAM_LEN] = {0xffffffff, 0xffffffff};

static const pke_ecc_init_param g_nist_p224_init_param = {
    .mont_a = ecc_nist_p224_mont_a,
    .mont_b = ecc_nist_p224_mont_b,
    .mont_1_p = ecc_nist_p224_mont_1_p,
    .mont_1_n = ecc_nist_p224_mont_1_n,
    .rrp = ecc_nist_p224_rrp,
    .rrn = ecc_nist_p224_rrn,
    .const_1 = g_const_1 + PKE_LEN_224_OFFSET, /* here use the same value,
                                                  but the length is determined by the curve->ksize. */
    .const_0 = g_const_0,
    .mont_param_n = ecc_nist_p224_mont_param_n,
    .mont_param_p = ecc_nist_p224_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P256R
static const td_u8 ecc_nist_p256_p[] = {
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 ecc_nist_p256_a[] = {
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p256_b[] = {
    0x5a, 0xc6, 0x35, 0xd8, 0xaa, 0x3a, 0x93, 0xe7, 0xb3, 0xeb, 0xbd, 0x55, 0x76, 0x98, 0x86, 0xbc,
    0x65, 0x1d, 0x06, 0xb0, 0xcc, 0x53, 0xb0, 0xf6, 0x3b, 0xce, 0x3c, 0x3e, 0x27, 0xd2, 0x60, 0x4b
};

static const td_u8 ecc_nist_p256_gx[] = {
    0x6b, 0x17, 0xd1, 0xf2, 0xe1, 0x2c, 0x42, 0x47, 0xf8, 0xbc, 0xe6, 0xe5, 0x63, 0xa4, 0x40, 0xf2,
    0x77, 0x03, 0x7d, 0x81, 0x2d, 0xeb, 0x33, 0xa0, 0xf4, 0xa1, 0x39, 0x45, 0xd8, 0x98, 0xc2, 0x96
};

static const td_u8 ecc_nist_p256_gy[] = {
    0x4f, 0xe3, 0x42, 0xe2, 0xfe, 0x1a, 0x7f, 0x9b, 0x8e, 0xe7, 0xeb, 0x4a, 0x7c, 0x0f, 0x9e, 0x16,
    0x2b, 0xce, 0x33, 0x57, 0x6b, 0x31, 0x5e, 0xce, 0xcb, 0xb6, 0x40, 0x68, 0x37, 0xbf, 0x51, 0xf5
};

static const td_u8 ecc_nist_p256_n[] = {
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17, 0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x51
};

static const drv_pke_ecc_curve g_nist_p256_param = {
    .p = ecc_nist_p256_p,
    .a = ecc_nist_p256_a,
    .b = ecc_nist_p256_b,
    .gx = ecc_nist_p256_gx,
    .gy = ecc_nist_p256_gy,
    .n = ecc_nist_p256_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_256,
    .ecc_type = DRV_PKE_ECC_TYPE_FIPS_P256R
};

static const td_u8 ecc_nist_p256_mont_a[] = {
    0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p256_mont_b[] = {
    0x76, 0x1b, 0x22, 0xc0, 0x80, 0xc3, 0xc6, 0xac, 0x26, 0xf1, 0x55, 0x0c, 0x23, 0xf4, 0xf7, 0x8f,
    0x3b, 0x1b, 0xfa, 0x97, 0xb2, 0x54, 0xbc, 0xb8, 0xdc, 0x43, 0xd9, 0x9b, 0x5e, 0xe4, 0x86, 0x5f
};

static const td_u8 ecc_nist_p256_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p256_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x43, 0x19, 0x05, 0x52, 0x58, 0xe8, 0x61, 0x7b, 0x0c, 0x46, 0x35, 0x3d, 0x03, 0x9c, 0xda, 0xaf
};

static const td_u8 ecc_nist_p256_rrp[] = {
    0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03
};

static const td_u8 ecc_nist_p256_rrn[] = {
    0x66, 0xe1, 0x2d, 0x94, 0xf3, 0xd9, 0x56, 0x20, 0x28, 0x45, 0xb2, 0x39, 0x2b, 0x6b, 0xec, 0x59,
    0x46, 0x99, 0x79, 0x9c, 0x49, 0xbd, 0x6f, 0xa6, 0x83, 0x24, 0x4c, 0x95, 0xbe, 0x79, 0xee, 0xa2
};

static const td_u32 ecc_nist_p256_mont_param_n[PKE_MONT_PARAM_LEN] = {0xccd1c8aa, 0xee00bc4f};

static const td_u32 ecc_nist_p256_mont_param_p[PKE_MONT_PARAM_LEN] = {0x0, 0x1};

static const pke_ecc_init_param g_nist_p256_init_param = {
    .mont_a = ecc_nist_p256_mont_a,
    .mont_b = ecc_nist_p256_mont_b,
    .mont_1_p = ecc_nist_p256_mont_1_p,
    .mont_1_n = ecc_nist_p256_mont_1_n,
    .rrp = ecc_nist_p256_rrp,
    .rrn = ecc_nist_p256_rrn,
    .const_1 = g_const_1 + PKE_LEN_256_OFFSET, /* here use the same value,
                                                  but the length is determined by the curve->ksize. */
    .const_0 = g_const_0,
    .mont_param_n = ecc_nist_p256_mont_param_n,
    .mont_param_p = ecc_nist_p256_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P384R
static const td_u8 ecc_nist_p384_p[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 ecc_nist_p384_a[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p384_b[] = {
    0xb3, 0x31, 0x2f, 0xa7, 0xe2, 0x3e, 0xe7, 0xe4, 0x98, 0x8e, 0x05, 0x6b, 0xe3, 0xf8, 0x2d, 0x19,
    0x18, 0x1d, 0x9c, 0x6e, 0xfe, 0x81, 0x41, 0x12, 0x03, 0x14, 0x08, 0x8f, 0x50, 0x13, 0x87, 0x5a,
    0xc6, 0x56, 0x39, 0x8d, 0x8a, 0x2e, 0xd1, 0x9d, 0x2a, 0x85, 0xc8, 0xed, 0xd3, 0xec, 0x2a, 0xef
};

static const td_u8 ecc_nist_p384_gx[] = {
    0xaa, 0x87, 0xca, 0x22, 0xbe, 0x8b, 0x05, 0x37, 0x8e, 0xb1, 0xc7, 0x1e, 0xf3, 0x20, 0xad, 0x74,
    0x6e, 0x1d, 0x3b, 0x62, 0x8b, 0xa7, 0x9b, 0x98, 0x59, 0xf7, 0x41, 0xe0, 0x82, 0x54, 0x2a, 0x38,
    0x55, 0x02, 0xf2, 0x5d, 0xbf, 0x55, 0x29, 0x6c, 0x3a, 0x54, 0x5e, 0x38, 0x72, 0x76, 0x0a, 0xb7
};

static const td_u8 ecc_nist_p384_gy[] = {
    0x36, 0x17, 0xde, 0x4a, 0x96, 0x26, 0x2c, 0x6f, 0x5d, 0x9e, 0x98, 0xbf, 0x92, 0x92, 0xdc, 0x29,
    0xf8, 0xf4, 0x1d, 0xbd, 0x28, 0x9a, 0x14, 0x7c, 0xe9, 0xda, 0x31, 0x13, 0xb5, 0xf0, 0xb8, 0xc0,
    0x0a, 0x60, 0xb1, 0xce, 0x1d, 0x7e, 0x81, 0x9d, 0x7a, 0x43, 0x1d, 0x7c, 0x90, 0xea, 0x0e, 0x5f
};

static const td_u8 ecc_nist_p384_n[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x63, 0x4d, 0x81, 0xf4, 0x37, 0x2d, 0xdf,
    0x58, 0x1a, 0x0d, 0xb2, 0x48, 0xb0, 0xa7, 0x7a, 0xec, 0xec, 0x19, 0x6a, 0xcc, 0xc5, 0x29, 0x73
};

static const drv_pke_ecc_curve g_nist_p384_param = {
    .p = ecc_nist_p384_p,
    .a = ecc_nist_p384_a,
    .b = ecc_nist_p384_b,
    .gx = ecc_nist_p384_gx,
    .gy = ecc_nist_p384_gy,
    .n = ecc_nist_p384_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_384,
    .ecc_type = DRV_PKE_ECC_TYPE_FIPS_P384R
};

static const td_u8 ecc_nist_p384_mont_a[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb,
    0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p384_mont_b[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x85, 0x4d, 0xde, 0x64, 0x9b, 0x65, 0x0a, 0xc2, 0x3b, 0x4e, 0x88, 0xaa, 0xd9, 0x9a, 0xef, 0xfb,
    0xd3, 0xc1, 0xf8, 0x58, 0xa0, 0x25, 0x5e, 0x78, 0xe7, 0x10, 0x0f, 0xf1, 0x68, 0x07, 0x4a, 0x30
};

static const td_u8 ecc_nist_p384_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p384_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9c, 0xb2, 0x7e, 0x0b, 0xc8, 0xd2, 0x20,
    0xa7, 0xe5, 0xf2, 0x4d, 0xb7, 0x4f, 0x58, 0x85, 0x13, 0x13, 0xe6, 0x95, 0x33, 0x3a, 0xd6, 0x8d
};

static const td_u8 ecc_nist_p384_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
    0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 ecc_nist_p384_rrn[] = {
    0x0c, 0x84, 0xee, 0x01, 0x2b, 0x39, 0xbf, 0x21, 0x3f, 0xb0, 0x5b, 0x7a, 0x28, 0x26, 0x68, 0x95,
    0xd4, 0x0d, 0x49, 0x17, 0x4a, 0xab, 0x1c, 0xc5, 0xbc, 0x3e, 0x48, 0x3a, 0xfc, 0xb8, 0x29, 0x47,
    0xff, 0x3d, 0x81, 0xe5, 0xdf, 0x1a, 0xa4, 0x19, 0x2d, 0x31, 0x9b, 0x24, 0x19, 0xb4, 0x09, 0xa9
};

static const td_u32 ecc_nist_p384_mont_param_n[PKE_MONT_PARAM_LEN] = {0x6ed46089, 0xe88fdc45};

static const td_u32 ecc_nist_p384_mont_param_p[PKE_MONT_PARAM_LEN] = {0x1, 0x1};

static const pke_ecc_init_param g_nist_p384_init_param = {
    .mont_a = ecc_nist_p384_mont_a,
    .mont_b = ecc_nist_p384_mont_b,
    .mont_1_p = ecc_nist_p384_mont_1_p,
    .mont_1_n = ecc_nist_p384_mont_1_n,
    .rrp = ecc_nist_p384_rrp,
    .rrn = ecc_nist_p384_rrn,
    .const_1 = g_const_1 + PKE_LEN_384_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = ecc_nist_p384_mont_param_n,
    .mont_param_p = ecc_nist_p384_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P521R
static const td_u8 ecc_nist_p521_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 ecc_nist_p521_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 ecc_nist_p521_b[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x95, 0x3e, 0xb9, 0x61, 0x8e, 0x1c, 0x9a, 0x1f,
    0x92, 0x9a, 0x21, 0xa0, 0xb6, 0x85, 0x40, 0xee, 0xa2, 0xda, 0x72, 0x5b, 0x99, 0xb3, 0x15, 0xf3,
    0xb8, 0xb4, 0x89, 0x91, 0x8e, 0xf1, 0x09, 0xe1, 0x56, 0x19, 0x39, 0x51, 0xec, 0x7e, 0x93, 0x7b,
    0x16, 0x52, 0xc0, 0xbd, 0x3b, 0xb1, 0xbf, 0x07, 0x35, 0x73, 0xdf, 0x88, 0x3d, 0x2c, 0x34, 0xf1,
    0xef, 0x45, 0x1f, 0xd4, 0x6b, 0x50, 0x3f, 0x00
};

static const td_u8 ecc_nist_p521_gx[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x85, 0x8e, 0x06, 0xb7, 0x04, 0x04, 0xe9, 0xcd,
    0x9e, 0x3e, 0xcb, 0x66, 0x23, 0x95, 0xb4, 0x42, 0x9c, 0x64, 0x81, 0x39, 0x05, 0x3f, 0xb5, 0x21,
    0xf8, 0x28, 0xaf, 0x60, 0x6b, 0x4d, 0x3d, 0xba, 0xa1, 0x4b, 0x5e, 0x77, 0xef, 0xe7, 0x59, 0x28,
    0xfe, 0x1d, 0xc1, 0x27, 0xa2, 0xff, 0xa8, 0xde, 0x33, 0x48, 0xb3, 0xc1, 0x85, 0x6a, 0x42, 0x9b,
    0xf9, 0x7e, 0x7e, 0x31, 0xc2, 0xe5, 0xbd, 0x66
};

static const td_u8 ecc_nist_p521_gy[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x18, 0x39, 0x29, 0x6a, 0x78, 0x9a, 0x3b, 0xc0, 0x04,
    0x5c, 0x8a, 0x5f, 0xb4, 0x2c, 0x7d, 0x1b, 0xd9, 0x98, 0xf5, 0x44, 0x49, 0x57, 0x9b, 0x44, 0x68,
    0x17, 0xaf, 0xbd, 0x17, 0x27, 0x3e, 0x66, 0x2c, 0x97, 0xee, 0x72, 0x99, 0x5e, 0xf4, 0x26, 0x40,
    0xc5, 0x50, 0xb9, 0x01, 0x3f, 0xad, 0x07, 0x61, 0x35, 0x3c, 0x70, 0x86, 0xa2, 0x72, 0xc2, 0x40,
    0x88, 0xbe, 0x94, 0x76, 0x9f, 0xd1, 0x66, 0x50
};

static const td_u8 ecc_nist_p521_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x51, 0x86, 0x87, 0x83, 0xbf, 0x2f, 0x96, 0x6b,
    0x7f, 0xcc, 0x01, 0x48, 0xf7, 0x09, 0xa5, 0xd0, 0x3b, 0xb5, 0xc9, 0xb8, 0x89, 0x9c, 0x47, 0xae,
    0xbb, 0x6f, 0xb7, 0x1e, 0x91, 0x38, 0x64, 0x09
};

static const drv_pke_ecc_curve g_nist_p521_param = {
    .p = ecc_nist_p521_p,
    .a = ecc_nist_p521_a,
    .b = ecc_nist_p521_b,
    .gx = ecc_nist_p521_gx,
    .gy = ecc_nist_p521_gy,
    .n = ecc_nist_p521_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_576,
    .ecc_type = DRV_PKE_ECC_TYPE_FIPS_P521R
};

static const td_u8 ecc_nist_p521_mont_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 ecc_nist_p521_mont_b[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x9b, 0xc6, 0x9d, 0xc3, 0x35, 0x4a, 0x1a,
    0x51, 0x27, 0xc1, 0x67, 0xca, 0xf7, 0xf3, 0x19, 0x0c, 0xd3, 0x1d, 0xaf, 0x93, 0xf6, 0xd2, 0x75,
    0x74, 0x56, 0x6e, 0x5d, 0x7b, 0x95, 0x8d, 0xee
};

static const td_u8 ecc_nist_p521_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_nist_p521_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x02, 0xd7, 0x3c, 0xbc, 0x3e, 0x20, 0x68, 0x34, 0xca, 0x40, 0x19, 0xff, 0x5b, 0x84, 0x7b, 0x2d,
    0x17, 0xe2, 0x25, 0x1b, 0x23, 0xbb, 0x31, 0xdc, 0x28, 0xa2, 0x48, 0x24, 0x70, 0xb7, 0x63, 0xcd,
    0xfb, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_nist_p521_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_nist_p521_rrn[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x2d, 0x8e, 0x03, 0xd1, 0x49, 0x2d, 0x0d, 0x45,
    0x5b, 0xcc, 0x6d, 0x61, 0xa8, 0xe5, 0x67, 0xbc, 0xcf, 0xf3, 0xd1, 0x42, 0xb7, 0x75, 0x6e, 0x3e,
    0xdd, 0x6e, 0x23, 0xd8, 0x2e, 0x49, 0xc7, 0xdb, 0xd3, 0x72, 0x1e, 0xf5, 0x57, 0xf7, 0x5e, 0x06,
    0x12, 0xa7, 0x8d, 0x38, 0x79, 0x45, 0x73, 0xff, 0xf7, 0x07, 0xba, 0xdc, 0xe5, 0x54, 0x7e, 0xa3,
    0x13, 0x7c, 0xd0, 0x4d, 0xcf, 0x15, 0xdd, 0x04
};

static const td_u32 ecc_nist_p521_mont_param_n[PKE_MONT_PARAM_LEN] = {0x1d2f5ccd, 0x79a995c7};

static const td_u32 ecc_nist_p521_mont_param_p[PKE_MONT_PARAM_LEN] = {0x0, 0x1};

static const pke_ecc_init_param g_nist_p521_init_param = {
    .mont_a = ecc_nist_p521_mont_a,
    .mont_b = ecc_nist_p521_mont_b,
    .mont_1_p = ecc_nist_p521_mont_1_p,
    .mont_1_n = ecc_nist_p521_mont_1_n,
    .rrp = ecc_nist_p521_rrp,
    .rrn = ecc_nist_p521_rrn,
    .const_1 = g_const_1,
    .const_0 = g_const_0,
    .mont_param_n = ecc_nist_p521_mont_param_n,
    .mont_param_p = ecc_nist_p521_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_BP256R
static const td_u8 ecc_brainpool_256r1_p[] = {
    0xa9, 0xfb, 0x57, 0xdb, 0xa1, 0xee, 0xa9, 0xbc, 0x3e, 0x66, 0x0a, 0x90, 0x9d, 0x83, 0x8d, 0x72,
    0x6e, 0x3b, 0xf6, 0x23, 0xd5, 0x26, 0x20, 0x28, 0x20, 0x13, 0x48, 0x1d, 0x1f, 0x6e, 0x53, 0x77
};

static const td_u8 ecc_brainpool_256r1_a[] = {
    0x7d, 0x5a, 0x09, 0x75, 0xfc, 0x2c, 0x30, 0x57, 0xee, 0xf6, 0x75, 0x30, 0x41, 0x7a, 0xff, 0xe7,
    0xfb, 0x80, 0x55, 0xc1, 0x26, 0xdc, 0x5c, 0x6c, 0xe9, 0x4a, 0x4b, 0x44, 0xf3, 0x30, 0xb5, 0xd9
};

static const td_u8 ecc_brainpool_256r1_b[] = {
    0x26, 0xdc, 0x5c, 0x6c, 0xe9, 0x4a, 0x4b, 0x44, 0xf3, 0x30, 0xb5, 0xd9, 0xbb, 0xd7, 0x7c, 0xbf,
    0x95, 0x84, 0x16, 0x29, 0x5c, 0xf7, 0xe1, 0xce, 0x6b, 0xcc, 0xdc, 0x18, 0xff, 0x8c, 0x07, 0xb6
};

static const td_u8 ecc_brainpool_256r1_gx[] = {
    0x8b, 0xd2, 0xae, 0xb9, 0xcb, 0x7e, 0x57, 0xcb, 0x2c, 0x4b, 0x48, 0x2f, 0xfc, 0x81, 0xb7, 0xaf,
    0xb9, 0xde, 0x27, 0xe1, 0xe3, 0xbd, 0x23, 0xc2, 0x3a, 0x44, 0x53, 0xbd, 0x9a, 0xce, 0x32, 0x62
};

static const td_u8 ecc_brainpool_256r1_gy[] = {
    0x54, 0x7e, 0xf8, 0x35, 0xc3, 0xda, 0xc4, 0xfd, 0x97, 0xf8, 0x46, 0x1a, 0x14, 0x61, 0x1d, 0xc9,
    0xc2, 0x77, 0x45, 0x13, 0x2d, 0xed, 0x8e, 0x54, 0x5c, 0x1d, 0x54, 0xc7, 0x2f, 0x04, 0x69, 0x97
};

static const td_u8 ecc_brainpool_256r1_n[] = {
    0xa9, 0xfb, 0x57, 0xdb, 0xa1, 0xee, 0xa9, 0xbc, 0x3e, 0x66, 0x0a, 0x90, 0x9d, 0x83, 0x8d, 0x71,
    0x8c, 0x39, 0x7a, 0xa3, 0xb5, 0x61, 0xa6, 0xf7, 0x90, 0x1e, 0x0e, 0x82, 0x97, 0x48, 0x56, 0xa7
};

static const drv_pke_ecc_curve g_brainpool_256r1_param = {
    .p = ecc_brainpool_256r1_p,
    .a = ecc_brainpool_256r1_a,
    .b = ecc_brainpool_256r1_b,
    .gx = ecc_brainpool_256r1_gx,
    .gy = ecc_brainpool_256r1_gy,
    .n = ecc_brainpool_256r1_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_256,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC5639_P256
};

static const td_u8 ecc_brainpool_256r1_mont_a[] = {
    0x1e, 0x46, 0x76, 0xab, 0xd6, 0x66, 0xbc, 0x17, 0x95, 0xec, 0x1e, 0x5e, 0x63, 0x98, 0x55, 0x6e,
    0xa6, 0x81, 0x23, 0xf1, 0xc1, 0xd2, 0x0c, 0x64, 0xd5, 0xd1, 0x8e, 0xdf, 0x69, 0x69, 0x62, 0x61
};

static const td_u8 ecc_brainpool_256r1_mont_b[] = {
    0x17, 0x51, 0x84, 0x96, 0x77, 0xb9, 0xfb, 0xe8, 0xa3, 0x32, 0x55, 0xdf, 0x6e, 0x0c, 0x81, 0x37,
    0x8c, 0xeb, 0x14, 0xe8, 0xf1, 0x5f, 0xab, 0xca, 0x22, 0x71, 0x2a, 0xce, 0xd5, 0xc5, 0xc0, 0x9b
};

static const td_u8 ecc_brainpool_256r1_mont_1_p[] = {
    0x56, 0x04, 0xa8, 0x24, 0x5e, 0x11, 0x56, 0x43, 0xc1, 0x99, 0xf5, 0x6f, 0x62, 0x7c, 0x72, 0x8d,
    0x91, 0xc4, 0x09, 0xdc, 0x2a, 0xd9, 0xdf, 0xd7, 0xdf, 0xec, 0xb7, 0xe2, 0xe0, 0x91, 0xac, 0x89
};

static const td_u8 ecc_brainpool_256r1_mont_1_n[] = {
    0x56, 0x04, 0xa8, 0x24, 0x5e, 0x11, 0x56, 0x43, 0xc1, 0x99, 0xf5, 0x6f, 0x62, 0x7c, 0x72, 0x8e,
    0x73, 0xc6, 0x85, 0x5c, 0x4a, 0x9e, 0x59, 0x08, 0x6f, 0xe1, 0xf1, 0x7d, 0x68, 0xb7, 0xa9, 0x59
};

static const td_u8 ecc_brainpool_256r1_rrp[] = {
    0x47, 0x17, 0xaa, 0x21, 0xe5, 0x95, 0x7f, 0xa8, 0xa1, 0xec, 0xda, 0xcd, 0x6b, 0x1a, 0xc8, 0x07,
    0x5c, 0xce, 0x4c, 0x26, 0x61, 0x4d, 0x4f, 0x4d, 0x8c, 0xfe, 0xdf, 0x7b, 0xa6, 0x46, 0x5b, 0x6c
};

static const td_u8 ecc_brainpool_256r1_rrn[] = {
    0x0b, 0x25, 0xf1, 0xb9, 0xc3, 0x23, 0x67, 0x62, 0x9b, 0x7f, 0x25, 0xe7, 0x6c, 0x81, 0x5c, 0xb0,
    0xf3, 0x5d, 0x17, 0x6a, 0x11, 0x34, 0xe4, 0xa0, 0xe1, 0xd8, 0xd8, 0xde, 0x33, 0x12, 0xfc, 0xa6
};

static const td_u32 ecc_brainpool_256r1_mont_param_n[PKE_MONT_PARAM_LEN] = {0xfbffbebd, 0xcbb40ee9};

static const td_u32 ecc_brainpool_256r1_mont_param_p[PKE_MONT_PARAM_LEN] = {0xc6a75590, 0xcefd89b9};

static const pke_ecc_init_param g_brainpool_256r1_init_param = {
    .mont_a = ecc_brainpool_256r1_mont_a,
    .mont_b = ecc_brainpool_256r1_mont_b,
    .mont_1_p = ecc_brainpool_256r1_mont_1_p,
    .mont_1_n = ecc_brainpool_256r1_mont_1_n,
    .rrp = ecc_brainpool_256r1_rrp,
    .rrn = ecc_brainpool_256r1_rrn,
    .const_1 = g_const_1 + PKE_LEN_256_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = ecc_brainpool_256r1_mont_param_n,
    .mont_param_p = ecc_brainpool_256r1_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_BP384R
static const td_u8 ecc_brainpool_384r1_p[] = {
    0x8c, 0xb9, 0x1e, 0x82, 0xa3, 0x38, 0x6d, 0x28, 0x0f, 0x5d, 0x6f, 0x7e, 0x50, 0xe6, 0x41, 0xdf,
    0x15, 0x2f, 0x71, 0x09, 0xed, 0x54, 0x56, 0xb4, 0x12, 0xb1, 0xda, 0x19, 0x7f, 0xb7, 0x11, 0x23,
    0xac, 0xd3, 0xa7, 0x29, 0x90, 0x1d, 0x1a, 0x71, 0x87, 0x47, 0x00, 0x13, 0x31, 0x07, 0xec, 0x53
};

static const td_u8 ecc_brainpool_384r1_a[] = {
    0x7b, 0xc3, 0x82, 0xc6, 0x3d, 0x8c, 0x15, 0x0c, 0x3c, 0x72, 0x08, 0x0a, 0xce, 0x05, 0xaf, 0xa0,
    0xc2, 0xbe, 0xa2, 0x8e, 0x4f, 0xb2, 0x27, 0x87, 0x13, 0x91, 0x65, 0xef, 0xba, 0x91, 0xf9, 0x0f,
    0x8a, 0xa5, 0x81, 0x4a, 0x50, 0x3a, 0xd4, 0xeb, 0x04, 0xa8, 0xc7, 0xdd, 0x22, 0xce, 0x28, 0x26
};

static const td_u8 ecc_brainpool_384r1_b[] = {
    0x04, 0xa8, 0xc7, 0xdd, 0x22, 0xce, 0x28, 0x26, 0x8b, 0x39, 0xb5, 0x54, 0x16, 0xf0, 0x44, 0x7c,
    0x2f, 0xb7, 0x7d, 0xe1, 0x07, 0xdc, 0xd2, 0xa6, 0x2e, 0x88, 0x0e, 0xa5, 0x3e, 0xeb, 0x62, 0xd5,
    0x7c, 0xb4, 0x39, 0x02, 0x95, 0xdb, 0xc9, 0x94, 0x3a, 0xb7, 0x86, 0x96, 0xfa, 0x50, 0x4c, 0x11
};

static const td_u8 ecc_brainpool_384r1_gx[] = {
    0x1D, 0x1C, 0x64, 0xF0, 0x68, 0xCF, 0x45, 0xFF, 0xA2, 0xA6, 0x3A, 0x81, 0xB7, 0xC1, 0x3F, 0x6B,
    0x88, 0x47, 0xA3, 0xE7, 0x7E, 0xF1, 0x4F, 0xE3, 0xDB, 0x7F, 0xCA, 0xFE, 0x0C, 0xBD, 0x10, 0xE8,
    0xE8, 0x26, 0xE0, 0x34, 0x36, 0xD6, 0x46, 0xAA, 0xEF, 0x87, 0xB2, 0xE2, 0x47, 0xD4, 0xAF, 0x1E
};

static const td_u8 ecc_brainpool_384r1_gy[] = {
    0x8A, 0xBE, 0x1D, 0x75, 0x20, 0xF9, 0xC2, 0xA4, 0x5C, 0xB1, 0xEB, 0x8E, 0x95, 0xCF, 0xD5, 0x52,
    0x62, 0xB7, 0x0B, 0x29, 0xFE, 0xEC, 0x58, 0x64, 0xE1, 0x9C, 0x05, 0x4F, 0xF9, 0x91, 0x29, 0x28,
    0x0E, 0x46, 0x46, 0x21, 0x77, 0x91, 0x81, 0x11, 0x42, 0x82, 0x03, 0x41, 0x26, 0x3C, 0x53, 0x15
};

static const td_u8 ecc_brainpool_384r1_n[] = {
    0x8C, 0xB9, 0x1E, 0x82, 0xA3, 0x38, 0x6D, 0x28, 0x0F, 0x5D, 0x6F, 0x7E, 0x50, 0xE6, 0x41, 0xDF,
    0x15, 0x2F, 0x71, 0x09, 0xED, 0x54, 0x56, 0xB3, 0x1F, 0x16, 0x6E, 0x6C, 0xAC, 0x04, 0x25, 0xA7,
    0xCF, 0x3A, 0xB6, 0xAF, 0x6B, 0x7F, 0xC3, 0x10, 0x3B, 0x88, 0x32, 0x02, 0xE9, 0x04, 0x65, 0x65
};

static const drv_pke_ecc_curve g_brainpool_384r1_param = {
    .p = ecc_brainpool_384r1_p,
    .a = ecc_brainpool_384r1_a,
    .b = ecc_brainpool_384r1_b,
    .gx = ecc_brainpool_384r1_gx,
    .gy = ecc_brainpool_384r1_gy,
    .n = ecc_brainpool_384r1_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_384,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC5639_P384
};

static const td_u8 ecc_brainpool_384r1_mont_a[] = {
    0x7c, 0x33, 0x80, 0x21, 0xa2, 0xe8, 0xc0, 0xd1, 0x40, 0x0a, 0x8f, 0xdf, 0x42, 0xb0, 0x0c, 0x60,
    0xe7, 0xff, 0xe9, 0xe5, 0x35, 0x52, 0x93, 0x74, 0x93, 0x67, 0x71, 0xb9, 0xd7, 0xf1, 0x0d, 0xb4,
    0x75, 0xd7, 0xf3, 0xfe, 0xf1, 0x57, 0xb0, 0x7b, 0xdb, 0x26, 0xb8, 0x95, 0x46, 0x6c, 0x3c, 0x99
};

static const td_u8 ecc_brainpool_384r1_mont_b[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x1b, 0xd6, 0xab, 0x49, 0xbd, 0xe7, 0xbf, 0x35, 0xfb, 0x50, 0xed, 0xe9, 0xf6, 0x29, 0xd0, 0xc1,
    0xbf, 0x50, 0xbd, 0xc6, 0x38, 0x2b, 0xdd, 0xd0, 0xa1, 0x96, 0x7a, 0x26, 0x66, 0xb6, 0x63, 0x72
};

static const td_u8 ecc_brainpool_384r1_mont_1_p[] = {
    0x73, 0x46, 0xe1, 0x7d, 0x5c, 0xc7, 0x92, 0xd7, 0xf0, 0xa2, 0x90, 0x81, 0xaf, 0x19, 0xbe, 0x20,
    0xea, 0xd0, 0x8e, 0xf6, 0x12, 0xab, 0xa9, 0x4b, 0xed, 0x4e, 0x25, 0xe6, 0x80, 0x48, 0xee, 0xdc,
    0x53, 0x2c, 0x58, 0xd6, 0x6f, 0xe2, 0xe5, 0x8e, 0x78, 0xb8, 0xff, 0xec, 0xce, 0xf8, 0x13, 0xad
};

static const td_u8 ecc_brainpool_384r1_mont_1_n[] = {
    0x73, 0x46, 0xe1, 0x7d, 0x5c, 0xc7, 0x92, 0xd7, 0xf0, 0xa2, 0x90, 0x81, 0xaf, 0x19, 0xbe, 0x20,
    0xea, 0xd0, 0x8e, 0xf6, 0x12, 0xab, 0xa9, 0x4c, 0xe0, 0xe9, 0x91, 0x93, 0x53, 0xfb, 0xda, 0x58,
    0x30, 0xc5, 0x49, 0x50, 0x94, 0x80, 0x3c, 0xef, 0xc4, 0x77, 0xcd, 0xfd, 0x16, 0xfb, 0x9a, 0x9b
};

static const td_u8 ecc_brainpool_384r1_rrp[] = {
    0x36, 0xbf, 0x68, 0x83, 0x17, 0x8d, 0xf8, 0x42, 0xd5, 0xc6, 0xef, 0x3b, 0xa5, 0x7e, 0x05, 0x2c,
    0x62, 0x14, 0x01, 0x91, 0x99, 0x18, 0xd5, 0xaf, 0x8e, 0x28, 0xf9, 0x9c, 0xc9, 0x94, 0x08, 0x99,
    0x53, 0x52, 0x83, 0x34, 0x3d, 0x7f, 0xd9, 0x65, 0x08, 0x7c, 0xef, 0xff, 0x40, 0xb6, 0x4b, 0xde
};

static const td_u8 ecc_brainpool_384r1_rrn[] = {
    0x0c, 0xe8, 0x94, 0x1a, 0x61, 0x4e, 0x97, 0xc2, 0x8f, 0x88, 0x6d, 0xc9, 0x65, 0x16, 0x5f, 0xdb,
    0x57, 0x4a, 0x74, 0xcb, 0x52, 0xd7, 0x48, 0xff, 0x2a, 0x92, 0x7e, 0x3b, 0x98, 0x02, 0x68, 0x8a,
    0x37, 0x26, 0x4e, 0x20, 0x2f, 0x2b, 0x6b, 0x6e, 0xac, 0x4e, 0xd3, 0xa2, 0xde, 0x77, 0x1c, 0x8e
};

static const td_u32 ecc_brainpool_384r1_mont_param_n[PKE_MONT_PARAM_LEN] = {0x5cfedd2a, 0x5cb5bb93};

static const td_u32 ecc_brainpool_384r1_mont_param_p[PKE_MONT_PARAM_LEN] = {0x9a6ea96c, 0xea9ec825};

static const pke_ecc_init_param g_brainpool_384r1_init_param = {
    .mont_a = ecc_brainpool_384r1_mont_a,
    .mont_b = ecc_brainpool_384r1_mont_b,
    .mont_1_p = ecc_brainpool_384r1_mont_1_p,
    .mont_1_n = ecc_brainpool_384r1_mont_1_n,
    .rrp = ecc_brainpool_384r1_rrp,
    .rrn = ecc_brainpool_384r1_rrn,
    .const_1 = g_const_1 + PKE_LEN_384_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = ecc_brainpool_384r1_mont_param_n,
    .mont_param_p = ecc_brainpool_384r1_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_BP512R
static const td_u8 ecc_brainpool_512r1_p[] = {
    0xaa, 0xdd, 0x9d, 0xb8, 0xdb, 0xe9, 0xc4, 0x8b, 0x3f, 0xd4, 0xe6, 0xae, 0x33, 0xc9, 0xfc, 0x07,
    0xcb, 0x30, 0x8d, 0xb3, 0xb3, 0xc9, 0xd2, 0x0e, 0xd6, 0x63, 0x9c, 0xca, 0x70, 0x33, 0x08, 0x71,
    0x7d, 0x4d, 0x9b, 0x00, 0x9b, 0xc6, 0x68, 0x42, 0xae, 0xcd, 0xa1, 0x2a, 0xe6, 0xa3, 0x80, 0xe6,
    0x28, 0x81, 0xff, 0x2f, 0x2d, 0x82, 0xc6, 0x85, 0x28, 0xaa, 0x60, 0x56, 0x58, 0x3a, 0x48, 0xf3
};

static const td_u8 ecc_brainpool_512r1_a[] = {
    0x78, 0x30, 0xa3, 0x31, 0x8b, 0x60, 0x3b, 0x89, 0xe2, 0x32, 0x71, 0x45, 0xac, 0x23, 0x4c, 0xc5,
    0x94, 0xcb, 0xdd, 0x8d, 0x3d, 0xf9, 0x16, 0x10, 0xa8, 0x34, 0x41, 0xca, 0xea, 0x98, 0x63, 0xbc,
    0x2d, 0xed, 0x5d, 0x5a, 0xa8, 0x25, 0x3a, 0xa1, 0x0a, 0x2e, 0xf1, 0xc9, 0x8b, 0x9a, 0xc8, 0xb5,
    0x7f, 0x11, 0x17, 0xa7, 0x2b, 0xf2, 0xc7, 0xb9, 0xe7, 0xc1, 0xac, 0x4d, 0x77, 0xfc, 0x94, 0xca
};

static const td_u8 ecc_brainpool_512r1_b[] = {
    0x3d, 0xf9, 0x16, 0x10, 0xa8, 0x34, 0x41, 0xca, 0xea, 0x98, 0x63, 0xbc, 0x2d, 0xed, 0x5d, 0x5a,
    0xa8, 0x25, 0x3a, 0xa1, 0x0a, 0x2e, 0xf1, 0xc9, 0x8b, 0x9a, 0xc8, 0xb5, 0x7f, 0x11, 0x17, 0xa7,
    0x2b, 0xf2, 0xc7, 0xb9, 0xe7, 0xc1, 0xac, 0x4d, 0x77, 0xfc, 0x94, 0xca, 0xdc, 0x08, 0x3e, 0x67,
    0x98, 0x40, 0x50, 0xb7, 0x5e, 0xba, 0xe5, 0xdd, 0x28, 0x09, 0xbd, 0x63, 0x80, 0x16, 0xf7, 0x23
};

static const td_u8 ecc_brainpool_512r1_gx[] = {
    0x81, 0xae, 0xe4, 0xbd, 0xd8, 0x2e, 0xd9, 0x64, 0x5a, 0x21, 0x32, 0x2e, 0x9c, 0x4c, 0x6a, 0x93,
    0x85, 0xed, 0x9f, 0x70, 0xb5, 0xd9, 0x16, 0xc1, 0xb4, 0x3b, 0x62, 0xee, 0xf4, 0xd0, 0x09, 0x8e,
    0xff, 0x3b, 0x1f, 0x78, 0xe2, 0xd0, 0xd4, 0x8d, 0x50, 0xd1, 0x68, 0x7b, 0x93, 0xb9, 0x7d, 0x5f,
    0x7c, 0x6d, 0x50, 0x47, 0x40, 0x6a, 0x5e, 0x68, 0x8b, 0x35, 0x22, 0x09, 0xbc, 0xb9, 0xf8, 0x22
};

static const td_u8 ecc_brainpool_512r1_gy[] = {
    0x7d, 0xde, 0x38, 0x5d, 0x56, 0x63, 0x32, 0xec, 0xc0, 0xea, 0xbf, 0xa9, 0xcf, 0x78, 0x22, 0xfd,
    0xf2, 0x09, 0xf7, 0x00, 0x24, 0xa5, 0x7b, 0x1a, 0xa0, 0x00, 0xc5, 0x5b, 0x88, 0x1f, 0x81, 0x11,
    0xb2, 0xdc, 0xde, 0x49, 0x4a, 0x5f, 0x48, 0x5e, 0x5b, 0xca, 0x4b, 0xd8, 0x8a, 0x27, 0x63, 0xae,
    0xd1, 0xca, 0x2b, 0x2f, 0xa8, 0xf0, 0x54, 0x06, 0x78, 0xcd, 0x1e, 0x0f, 0x3a, 0xd8, 0x08, 0x92
};

static const td_u8 ecc_brainpool_512r1_n[] = {
    0xaa, 0xdd, 0x9d, 0xb8, 0xdb, 0xe9, 0xc4, 0x8b, 0x3f, 0xd4, 0xe6, 0xae, 0x33, 0xc9, 0xfc, 0x07,
    0xcb, 0x30, 0x8d, 0xb3, 0xb3, 0xc9, 0xd2, 0x0e, 0xd6, 0x63, 0x9c, 0xca, 0x70, 0x33, 0x08, 0x70,
    0x55, 0x3e, 0x5c, 0x41, 0x4c, 0xa9, 0x26, 0x19, 0x41, 0x86, 0x61, 0x19, 0x7f, 0xac, 0x10, 0x47,
    0x1d, 0xb1, 0xd3, 0x81, 0x08, 0x5d, 0xda, 0xdd, 0xb5, 0x87, 0x96, 0x82, 0x9c, 0xa9, 0x00, 0x69
};

const drv_pke_ecc_curve g_brainpool_512r1_param = {
    .p = ecc_brainpool_512r1_p,
    .a = ecc_brainpool_512r1_a,
    .b = ecc_brainpool_512r1_b,
    .gx = ecc_brainpool_512r1_gx,
    .gy = ecc_brainpool_512r1_gy,
    .n = ecc_brainpool_512r1_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_512,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC5639_P512
};

static const td_u8 ecc_brainpool_512r1_mont_a[] = {
    0x5e, 0xc4, 0xf1, 0x87, 0x22, 0x7d, 0x2a, 0x83, 0xb8, 0x3b, 0x84, 0xfa, 0xe2, 0xd0, 0x85, 0x0c,
    0x18, 0x2d, 0x0f, 0x59, 0xf4, 0x1e, 0x87, 0x78, 0xa5, 0xec, 0x30, 0xc8, 0x3f, 0x80, 0xd1, 0xc7,
    0xcf, 0x8f, 0x01, 0x11, 0x9e, 0x6e, 0x87, 0xff, 0x40, 0xb0, 0x4b, 0x72, 0x46, 0x75, 0xbb, 0xab,
    0x14, 0xe4, 0x95, 0x7d, 0xaf, 0xa7, 0xd2, 0x83, 0xda, 0x1f, 0x8a, 0x34, 0xea, 0x10, 0xc4, 0x46
};

static const td_u8 ecc_brainpool_512r1_mont_b[] = {
    0x6a, 0x4a, 0xab, 0xb4, 0x47, 0x1e, 0x8e, 0xa7, 0x64, 0x23, 0x12, 0xa5, 0x0b, 0xb5, 0xaa, 0xa2,
    0xcb, 0xda, 0x57, 0xac, 0x6d, 0x17, 0xd8, 0x1d, 0x97, 0xe0, 0x0c, 0x63, 0xfe, 0x22, 0x24, 0x33,
    0xc7, 0x3e, 0x30, 0xe8, 0x98, 0x77, 0xbe, 0x02, 0xe1, 0x6b, 0xa4, 0x56, 0x2d, 0x87, 0x24, 0xaa,
    0x00, 0x9b, 0x63, 0xc7, 0xe5, 0x8e, 0x5a, 0x34, 0x50, 0x7e, 0x83, 0x96, 0x20, 0xe9, 0x2a, 0x34
};

static const td_u8 ecc_brainpool_512r1_mont_1_p[] = {
    0x55, 0x22, 0x62, 0x47, 0x24, 0x16, 0x3b, 0x74, 0xc0, 0x2b, 0x19, 0x51, 0xcc, 0x36, 0x03, 0xf8,
    0x34, 0xcf, 0x72, 0x4c, 0x4c, 0x36, 0x2d, 0xf1, 0x29, 0x9c, 0x63, 0x35, 0x8f, 0xcc, 0xf7, 0x8e,
    0x82, 0xb2, 0x64, 0xff, 0x64, 0x39, 0x97, 0xbd, 0x51, 0x32, 0x5e, 0xd5, 0x19, 0x5c, 0x7f, 0x19,
    0xd7, 0x7e, 0x00, 0xd0, 0xd2, 0x7d, 0x39, 0x7a, 0xd7, 0x55, 0x9f, 0xa9, 0xa7, 0xc5, 0xb7, 0x0d
};

static const td_u8 ecc_brainpool_512r1_mont_1_n[] = {
    0x55, 0x22, 0x62, 0x47, 0x24, 0x16, 0x3b, 0x74, 0xc0, 0x2b, 0x19, 0x51, 0xcc, 0x36, 0x03, 0xf8,
    0x34, 0xcf, 0x72, 0x4c, 0x4c, 0x36, 0x2d, 0xf1, 0x29, 0x9c, 0x63, 0x35, 0x8f, 0xcc, 0xf7, 0x8f,
    0xaa, 0xc1, 0xa3, 0xbe, 0xb3, 0x56, 0xd9, 0xe6, 0xbe, 0x79, 0x9e, 0xe6, 0x80, 0x53, 0xef, 0xb8,
    0xe2, 0x4e, 0x2c, 0x7e, 0xf7, 0xa2, 0x25, 0x22, 0x4a, 0x78, 0x69, 0x7d, 0x63, 0x56, 0xff, 0x97
};

static const td_u8 ecc_brainpool_512r1_rrp[] = {
    0x3c, 0x4c, 0x9d, 0x05, 0xa9, 0xff, 0x64, 0x50, 0x20, 0x2e, 0x19, 0x40, 0x20, 0x56, 0xee, 0xcc,
    0xa1, 0x6d, 0xaa, 0x5f, 0xd4, 0x2b, 0xff, 0x83, 0x19, 0x48, 0x6f, 0xd8, 0xd5, 0x89, 0x80, 0x57,
    0xe0, 0xc1, 0x9a, 0x77, 0x83, 0x51, 0x4a, 0x25, 0x53, 0xb7, 0xf9, 0xbc, 0x90, 0x5a, 0xff, 0xd3,
    0x79, 0x3f, 0xb1, 0x30, 0x27, 0x15, 0x79, 0x05, 0x49, 0xad, 0x14, 0x4a, 0x61, 0x58, 0xf2, 0x05
};

static const td_u8 ecc_brainpool_512r1_rrn[] = {
    0xa7, 0x94, 0x58, 0x6a, 0x71, 0x84, 0x07, 0xb0, 0x95, 0xdf, 0x1b, 0x4c, 0x19, 0x4b, 0x2e, 0x56,
    0x72, 0x3c, 0x37, 0xa2, 0x2f, 0x16, 0xbb, 0xdf, 0xd7, 0xf9, 0xcc, 0x26, 0x3b, 0x79, 0x0d, 0xe3,
    0xa6, 0xf2, 0x30, 0xc7, 0x2f, 0x02, 0x07, 0xe8, 0x3e, 0xc6, 0x4b, 0xd0, 0x33, 0xb7, 0x62, 0x7f,
    0x08, 0x86, 0xb7, 0x58, 0x95, 0x28, 0x3d, 0xdd, 0xd2, 0xa3, 0x68, 0x1e, 0xcd, 0xa8, 0x16, 0x71
};

static const td_u32 ecc_brainpool_512r1_mont_param_n[PKE_MONT_PARAM_LEN] = {0xad49541f, 0xf1b7027};

static const td_u32 ecc_brainpool_512r1_mont_param_p[PKE_MONT_PARAM_LEN] = {0x839b3220, 0x7d89efc5};

const pke_ecc_init_param g_brainpool_512r1_init_param = {
    .mont_a = ecc_brainpool_512r1_mont_a,
    .mont_b = ecc_brainpool_512r1_mont_b,
    .mont_1_p = ecc_brainpool_512r1_mont_1_p,
    .mont_1_n = ecc_brainpool_512r1_mont_1_n,
    .rrp = ecc_brainpool_512r1_rrp,
    .rrn = ecc_brainpool_512r1_rrn,
    .const_1 = g_const_1 + PKE_LEN_512_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = ecc_brainpool_512r1_mont_param_n,
    .mont_param_p = ecc_brainpool_512r1_mont_param_p,
};
#endif

#if defined(CONFIG_PKE_SUPPORT_SM2)
static const td_u8 sm2_p[] = {
    0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

static const td_u8 sm2_a[] = {
    0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 sm2_b[] = {
    0x28, 0xe9, 0xfa, 0x9e, 0x9d, 0x9f, 0x5e, 0x34, 0x4d, 0x5a, 0x9e, 0x4b, 0xcf, 0x65, 0x09, 0xa7,
    0xf3, 0x97, 0x89, 0xf5, 0x15, 0xab, 0x8f, 0x92, 0xdd, 0xbc, 0xbd, 0x41, 0x4d, 0x94, 0x0e, 0x93
};

static const td_u8 sm2_gx[] = {
    0x32, 0xc4, 0xae, 0x2c, 0x1f, 0x19, 0x81, 0x19, 0x5f, 0x99, 0x04, 0x46, 0x6a, 0x39, 0xc9, 0x94,
    0x8f, 0xe3, 0x0b, 0xbf, 0xf2, 0x66, 0x0b, 0xe1, 0x71, 0x5a, 0x45, 0x89, 0x33, 0x4c, 0x74, 0xc7
};

static const td_u8 sm2_gy[] = {
    0xbc, 0x37, 0x36, 0xa2, 0xf4, 0xf6, 0x77, 0x9c, 0x59, 0xbd, 0xce, 0xe3, 0x6b, 0x69, 0x21, 0x53,
    0xd0, 0xa9, 0x87, 0x7c, 0xc6, 0x2a, 0x47, 0x40, 0x02, 0xdf, 0x32, 0xe5, 0x21, 0x39, 0xf0, 0xa0
};

static const td_u8 sm2_n[] = {
    0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0x72, 0x03, 0xdf, 0x6b, 0x21, 0xc6, 0x05, 0x2b, 0x53, 0xbb, 0xf4, 0x09, 0x39, 0xd5, 0x41, 0x23
};

const drv_pke_ecc_curve g_sm2_param = {
    .p = sm2_p,
    .a = sm2_a,
    .b = sm2_b,
    .gx = sm2_gx,
    .gy = sm2_gy,
    .n = sm2_n,
    .h = 0x1,
    .ksize = DRV_PKE_LEN_256,
    .ecc_type = DRV_PKE_ECC_TYPE_SM2
};

static const td_u8 sm2_mont_a[] = {
    0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc
};

static const td_u8 sm2_mont_b[] = {
    0x31, 0xbd, 0x80, 0x59, 0xbb, 0x3d, 0x1b, 0x0d, 0x69, 0x65, 0xa1, 0xe7, 0x3c, 0x26, 0xf2, 0xce,
    0x30, 0x6a, 0xee, 0x54, 0xf4, 0x7f, 0xd3, 0x39, 0xcd, 0xd2, 0xcb, 0x79, 0x36, 0xac, 0xe4, 0x51
};

static const td_u8 sm2_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};

static const td_u8 sm2_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x8d, 0xfc, 0x20, 0x94, 0xde, 0x39, 0xfa, 0xd4, 0xac, 0x44, 0x0b, 0xf6, 0xc6, 0x2a, 0xbe, 0xdd
};

static const td_u8 sm2_rrp[] = {
    0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
    0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03
};

static const td_u8 sm2_rrn[] = {
    0x1e, 0xb5, 0xe4, 0x12, 0xa2, 0x2b, 0x3d, 0x3b, 0x62, 0x0f, 0xc8, 0x4c, 0x3a, 0xff, 0xe0, 0xd4,
    0x34, 0x64, 0x50, 0x4a, 0xde, 0x6f, 0xa2, 0xfa, 0x90, 0x11, 0x92, 0xaf, 0x7c, 0x11, 0x4f, 0x20
};

static const td_u32 sm2_mont_param_n[PKE_MONT_PARAM_LEN] = {0x327f9e88, 0x72350975};

static const td_u32 sm2_mont_param_p[PKE_MONT_PARAM_LEN] = {0x0, 0x1};

const pke_ecc_init_param g_sm2_init_param = {
    .mont_a = sm2_mont_a,
    .mont_b = sm2_mont_b,
    .mont_1_p = sm2_mont_1_p,
    .mont_1_n = sm2_mont_1_n,
    .rrp = sm2_rrp,
    .rrn = sm2_rrn,
    .const_1 = g_const_1 + PKE_LEN_256_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = sm2_mont_param_n,
    .mont_param_p = sm2_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_CURVE_25519
static const td_u8 ecc_curve_25519_p[] = {
    0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED
};

static const td_u8 ecc_curve_25519_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xDB, 0x41
};

static const td_u8 ecc_curve_25519_gx[] = {
    0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_curve_25519_n[] = {
    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x14, 0xDE, 0xF9, 0xDE, 0xA2, 0xF7, 0x9C, 0xD6, 0x58, 0x12, 0x63, 0x1A, 0x5C, 0xF5, 0xD3, 0xED
};

const drv_pke_ecc_curve g_curve_25519_param = {
    .p = ecc_curve_25519_p,
    .a = ecc_curve_25519_a, /* here the a is a24. */
    .b = TD_NULL,
    .gx = ecc_curve_25519_gx,
    .gy = TD_NULL,
    .n = ecc_curve_25519_n,
    .h = 0x08,
    .ksize = DRV_PKE_LEN_256,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC7748
};

static const td_u8 ecc_curve_25519_mont_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8b, 0xa6
};

static const td_u8 ecc_curve_25519_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26
};

static const td_u8 ecc_curve_25519_mont_1_n[] = {
    0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xc6, 0xef, 0x5b, 0xf4, 0x73, 0x7d, 0xcf, 0x70, 0xd6, 0xec, 0x31, 0x74, 0x8d, 0x98, 0x95, 0x1d
};

static const td_u8 ecc_curve_25519_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa4
};

static const td_u8 ecc_curve_25519_rrn[] = {
    0x03, 0x99, 0x41, 0x1b, 0x7c, 0x30, 0x9a, 0x3d, 0xce, 0xec, 0x73, 0xd2, 0x17, 0xf5, 0xbe, 0x65,
    0xd0, 0x0e, 0x1b, 0xa7, 0x68, 0x85, 0x93, 0x47, 0xa4, 0x06, 0x11, 0xe3, 0x44, 0x9c, 0x0f, 0x01
};

/* no need for ecc_curve_25519_mont_param_n */
static const td_u32 ecc_curve_25519_mont_param_p[PKE_MONT_PARAM_LEN] = {0x86bca1af, 0x286bca1b};

const pke_ecc_init_param g_curve_25519_init_param = {
    /* here the mont_a is mont_a24. */
    .mont_a = ecc_curve_25519_mont_a,
    .mont_1_p = ecc_curve_25519_mont_1_p,
    .mont_1_n = ecc_curve_25519_mont_1_n,
    .rrp = ecc_curve_25519_rrp,
    .rrn = ecc_curve_25519_rrn,
    .const_1 = g_const_1 + PKE_LEN_256_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = TD_NULL,
    .mont_param_p = ecc_curve_25519_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_CURVE_448
static const td_u8 ecc_curve_448_p[] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

/* here the a is a24. */
static const td_u8 ecc_curve_448_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xa9
};

static const td_u8 ecc_curve_448_gx[] = {
    0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const td_u8 ecc_curve_448_n[] = {
    0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7c, 0xca, 0x23, 0xe9,
    0xc4, 0x4e, 0xdb, 0x49, 0xae, 0xd6, 0x36, 0x90, 0x21, 0x6c, 0xc2, 0x72, 0x8d, 0xc5, 0x8f, 0x55,
    0x23, 0x78, 0xc2, 0x92, 0xab, 0x58, 0x44, 0xf3
};

const drv_pke_ecc_curve g_curve_448_param = {
    .p = ecc_curve_448_p,
    .a = ecc_curve_448_a, /* here the a is a24. */
    .b = TD_NULL,
    .gx = ecc_curve_448_gx,
    .gy = TD_NULL,
    .n = ecc_curve_448_n,
    .h = 0x04,
    .ksize = DRV_PKE_LEN_448,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC7748_448
};

/* here the mont_a is mont_a24. */
static const td_u8 ecc_curve_448_mont_a[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xa9, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xa9
};

static const td_u8 ecc_curve_448_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01

};

static const td_u8 ecc_curve_448_mont_1_n[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0c, 0xd7, 0x70, 0x58,
    0xee, 0xc4, 0x92, 0xd9, 0x44, 0xa7, 0x25, 0xbf, 0x7a, 0x4c, 0xf6, 0x35, 0xc8, 0xe9, 0xc2, 0xab,
    0x72, 0x1c, 0xf5, 0xb5, 0x52, 0x9e, 0xec, 0x34
};

static const td_u8 ecc_curve_448_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
};

static const td_u8 ecc_curve_448_rrn[] = {
    0x34, 0x02, 0xa9, 0x39, 0xf8, 0x23, 0xb7, 0x29, 0x20, 0x52, 0xbc, 0xb7, 0xe4, 0xd0, 0x70, 0xaf,
    0x1a, 0x9c, 0xc1, 0x4b, 0xa3, 0xc4, 0x7c, 0x44, 0xae, 0x17, 0xcf, 0x72, 0x5e, 0xe4, 0xd8, 0x38,
    0x0d, 0x66, 0xde, 0x23, 0x88, 0xea, 0x18, 0x59, 0x7a, 0xf3, 0x2c, 0x4b, 0xc1, 0xb1, 0x95, 0xd9,
    0xe3, 0x53, 0x92, 0x57, 0x04, 0x9b, 0x9b, 0x60
};

/* no need for ecc_curve_448_mont_param_n */
static const td_u32 ecc_curve_448_mont_param_p[PKE_MONT_PARAM_LEN] = {0x0, 0x1};

const pke_ecc_init_param g_curve_448_init_param = {
    /* here the mont_a is mont_a24. */
    .mont_a = ecc_curve_448_mont_a,
    .mont_b = TD_NULL,
    .mont_1_p = ecc_curve_448_mont_1_p,
    .mont_1_n = ecc_curve_448_mont_1_n,
    .rrp = ecc_curve_448_rrp,
    .rrn = ecc_curve_448_rrn,
    .const_1 = g_const_1 + PKE_LEN_448_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = TD_NULL,
    .mont_param_p = ecc_curve_448_mont_param_p,
};
#endif

#ifdef CONFIG_PKE_SUPPORT_ECC_ED25519
static const td_u8 ed25519_p[] = {
    0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED
};

static const td_u8 ed25519_a[] = {
    0x52, 0x03, 0x6c, 0xee, 0x2b, 0x6f, 0xfe, 0x73, 0x8c, 0xc7, 0x40, 0x79, 0x77, 0x79, 0xe8, 0x98,
    0x00, 0x70, 0x0a, 0x4d, 0x41, 0x41, 0xd8, 0xab, 0x75, 0xeb, 0x4d, 0xca, 0x13, 0x59, 0x78, 0xa3
};

static const td_u8 ed25519_gx[] = {
    0x21, 0x69, 0x36, 0xd3, 0xcd, 0x6e, 0x53, 0xfe, 0xc0, 0xa4, 0xe2, 0x31, 0xfd, 0xd6, 0xdc, 0x5c,
    0x69, 0x2c, 0xc7, 0x60, 0x95, 0x25, 0xa7, 0xb2, 0xc9, 0x56, 0x2d, 0x60, 0x8f, 0x25, 0xd5, 0x1a
};

static const td_u8 ed25519_gy[] = {
    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
    0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x58
};

static const td_u8 ed25519_n[] = {
    0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x14, 0xDE, 0xF9, 0xDE, 0xA2, 0xF7, 0x9C, 0xD6, 0x58, 0x12, 0x63, 0x1A, 0x5C, 0xF5, 0xD3, 0xED
};

const drv_pke_ecc_curve g_ed25519_param = {
    .p = ed25519_p,
    /* here the a is d. */
    .a = ed25519_a,
    .b = TD_NULL,
    .gx = ed25519_gx,
    .gy = ed25519_gy,
    .n = ed25519_n,
    .h = 0x08,
    .ksize = DRV_PKE_LEN_256,
    .ecc_type = DRV_PKE_ECC_TYPE_RFC8032
};

static const td_u8 ed25519_mont_a[] = {
    0x2c, 0x82, 0x2b, 0x5a, 0x72, 0x9f, 0xc5, 0x26, 0xe5, 0x93, 0x92, 0x07, 0xbc, 0x18, 0x86, 0x90,
    0x10, 0xa1, 0x87, 0x77, 0xaf, 0xc6, 0x29, 0x73, 0x80, 0xed, 0x8b, 0xfe, 0xdf, 0x47, 0xe9, 0xfa
};

static const td_u8 ed25519_mont_b[] = {
    0x2b, 0x83, 0x24, 0x80, 0x4f, 0xc1, 0xdf, 0x0b, 0x2b, 0x4d, 0x00, 0x99, 0x3d, 0xfb, 0xd7, 0xa7,
    0x2f, 0x43, 0x18, 0x06, 0xad, 0x2f, 0xe4, 0x78, 0xc4, 0xee, 0x1b, 0x27, 0x4a, 0x0e, 0xa0, 0xb0
};

static const td_u8 ed25519_mont_1_p[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26
};

static const td_u8 ed25519_mont_1_n[] = {
    0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
    0xc6, 0xef, 0x5b, 0xf4, 0x73, 0x7d, 0xcf, 0x70, 0xd6, 0xec, 0x31, 0x74, 0x8d, 0x98, 0x95, 0x1d
};

static const td_u8 ed25519_rrp[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xa4
};

static const td_u8 ed25519_rrn[] = {
    0x03, 0x99, 0x41, 0x1b, 0x7c, 0x30, 0x9a, 0x3d, 0xce, 0xec, 0x73, 0xd2, 0x17, 0xf5, 0xbe, 0x65,
    0xd0, 0x0e, 0x1b, 0xa7, 0x68, 0x85, 0x93, 0x47, 0xa4, 0x06, 0x11, 0xe3, 0x44, 0x9c, 0x0f, 0x01
};

static const td_u32 ed25519_mont_param_n[PKE_MONT_PARAM_LEN] = {0xd2b51da3, 0x12547e1b};

static const td_u32 ed25519_mont_param_p[PKE_MONT_PARAM_LEN] = {0x86bca1af, 0x286bca1b};

const pke_ecc_init_param g_ed25519_init_param = {
    /* here the mont_a is mont_d = d * (2^bit_len) % p. */
    .mont_a = ed25519_mont_a,
    /* here the mont_b is sqrt_m1, the square root of (-1). */
    .mont_b = ed25519_mont_b,
    .mont_1_p = ed25519_mont_1_p,
    .mont_1_n = ed25519_mont_1_n,
    .rrp = ed25519_rrp,
    .rrn = ed25519_rrn,
    .const_1 = g_const_1 + PKE_LEN_256_OFFSET,
    .const_0 = g_const_0,
    .mont_param_n = ed25519_mont_param_n,
    .mont_param_p = ed25519_mont_param_p,
};
#endif
const pke_default_parameters g_crypto_ecc_params[] = {
#ifdef CONFIG_PKE_SUPPORT_ECC_BP256R
    {&g_brainpool_256r1_param, &g_brainpool_256r1_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_BP384R
    {&g_brainpool_384r1_param, &g_brainpool_384r1_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_BP512R
    {&g_brainpool_512r1_param, &g_brainpool_512r1_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P192R
    {&g_nist_p192_param, &g_nist_p192_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P224R
    {&g_nist_p224_param, &g_nist_p224_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P256R
    {&g_nist_p256_param, &g_nist_p256_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P384R
    {&g_nist_p384_param, &g_nist_p384_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_FIPS_P521R
    {&g_nist_p521_param, &g_nist_p521_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_CURVE_25519
    {&g_curve_25519_param, &g_curve_25519_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_CURVE_448
    {&g_curve_448_param, &g_curve_448_init_param},
#endif
#ifdef CONFIG_PKE_SUPPORT_ECC_ED25519
    {&g_ed25519_param, &g_ed25519_init_param},
#endif
#if defined(CONFIG_PKE_SUPPORT_SM2)
    {&g_sm2_param, &g_sm2_init_param},
#endif
};
const td_u32 g_crypto_ecc_num = sizeof(g_crypto_ecc_params) / sizeof(g_crypto_ecc_params[0]);

td_void crypto_curve_param_init(td_void)
{
    crypto_unused(g_const_0);
    crypto_unused(g_const_1);
    drv_cipher_pke_init_ecc_param(g_crypto_ecc_params, &g_crypto_ecc_num);
}

#if defined(CONFIG_ECP_CURVES_ALT)
const drv_pke_ecc_curve *secp192r1_curve(void)
{
    return &g_nist_p192_param;
}

const drv_pke_ecc_curve *secp224r1_curve(void)
{
    return &g_nist_p224_param;
}

const drv_pke_ecc_curve *secp256r1_curve(void)
{
    return &g_nist_p256_param;
}

const drv_pke_ecc_curve *secp384r1_curve(void)
{
    return &g_nist_p384_param;
}

const drv_pke_ecc_curve *secp521r1_curve(void)
{
    return &g_nist_p521_param;
}

const drv_pke_ecc_curve *brainpoolP256r1_curve(void)
{
    return &g_brainpool_256r1_param;
}

const drv_pke_ecc_curve *brainpoolP384r1_curve(void)
{
    return &g_brainpool_384r1_param;
}

const drv_pke_ecc_curve *brainpoolP512r1_curve(void)
{
    return &g_brainpool_512r1_param;
}

const drv_pke_ecc_curve *curve25519_curve(void)
{
    return &g_curve_25519_param;
}

const drv_pke_ecc_curve *curve448_curve(void)
{
    return &g_curve_448_param;
}
#endif